from ptc import *
from common import *
import time 

client = PTCClient('192.168.0.11', 12347)

file = open('test1k', 'r')
data_1kb = file.read()
datas = [data_1kb, data_1kb * 5, data_1kb * 10, data_1kb * 50, data_1kb * 100]
client.connect('192.168.0.11', 12346)

for data in datas:
    time_total = 0.0
    for i in range(1000):
        start_time = time.time()
        client.send(data)
        client.close()
        time_total += (time.time() - start_time)
    print time_total,"ms"

#client.close()


